import Vue from 'vue'

Vue.filter('classify',function (classifyIds, classifyList) {
  var classifyName = "";

  var firstClassify = _.find(classifyList, {"lid": classifyIds[0]})
  if(firstClassify){
    classifyName = firstClassify.label;

    if(classifyIds.length > 0){
      var secondClassify = _.find(firstClassify.children, {"lid": classifyIds[1]})
      if(secondClassify){
        classifyName +=  ' / ' + secondClassify.label;
      }
    }
  }

  return classifyName;
})